if SERVER then
	registerCommand("burn", "Turn on/off the player you specify being on fire", function(param)
		local fireOn = "caller set target on fire"
		local fireOff = "caller extinguished target"
		if param["settings"]["burn_msg_on"] then
			fireOn = param["settings"]["burn_msg_on"]
		end
		if param["settings"]["burn_msg_off"] then
			fireOff = param["settings"]["burn_msg_off"]
		end
		local waterOff = 0
		if param["settings"]["burn_water_off"] then
			waterOff = param["settings"]["burn_water_off"]
		end
		local fireTable = {}
		fireTable["caller"] = getCaller(param[1])
		local targs = string.Explode(" ", param[3])
		for i, targ in pairs(targs) do
			local plyTarg = getPlayerByName(targ)
			if plyTarg then
				fireTable["target"] = plyTarg:GetName()
				if (not plyTarg["moocow_burn"]) || plyTarg["moocow_burn"] == -1 then
					plyTarg["moocow_burn"] = 1
					plyTarg:Ignite(99999, 1)
					display(param[1], "burn", { plyTarg } , parseDisplayMessage(fireOn, fireTable))
					if waterOff == 1 then
						timer.Create("moocow_waterwalk" .. plyTarg:GetName(), 1, 0, moocow_endBurnWater, plyTarg)
					end
				else
					plyTarg["moocow_burn"] = -1
					plyTarg:Extinguish()
					display(param[1], "burn", { plyTarg } , parseDisplayMessage(fireOff, fireTable))
				end
			end
		end
	end)
	
	function moocow_endBurnWater(ply)
		if ply:WaterLevel() > 0 then
			ply["moocow_burn"] = -1
			ply:Extinguish()
			if timer.IsTimer("moocow_waterwalk" .. ply:GetName()) then
				timer.Remove("moocow_waterwalk" .. ply:GetName())
			end
		end
	end

	local function endBurn(victim, weapon, killer)
		if victim["moocow_burn"] then
			victim["moocow_burn"] = -1
			victim:Extinguish()
		end
	end
	hook.Add("PlayerDeath", "moocow_endBurn", endBurn)
end